package alejandro.castro.abstracts;

import alejandro.castro.asteroid.components.Shot;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.events.constants.Key;

public abstract class ShooterComponent extends CyclicSceneComponent {

	public ShooterComponent(double x, double y) {
		super(x, y);
	}
	
	@Override
	public void update(DeltaState delta) {
		super.update(delta);
		if(delta.isKeyPressed(Key.SPACE)){
			this.getScene().addShot(new Shot(centerX(), centerY(), currentAngle, xMove, yMove));
		}
	}
}
